import styles from './CodeBlockActionIcons.module.css'

export const SaveCodeBlockIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg role="img" height="16" width="16" viewBox="0 0 16 16" fill="currentColor">
        <path
            fillRule="evenodd"
            clipRule="evenodd"
            d="M9.5 1.1l3.4 3.5.1.4v2h-1V6H8V2H3v11h4v1H2.5l-.5-.5v-12l.5-.5h6.7l.3.1zM9 2v3h2.9L9 2zm4 14h-1v-3H9v-1h3V9h1v3h3v1h-3v3z"
        />
    </svg>
)

export const CopyCodeBlockIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg role="img" height="16" width="16" viewBox="0 0 16 16" fill="currentColor">
        <path
            fillRule="evenodd"
            clipRule="evenodd"
            d="M4 4l1-1h5.414L14 6.586V14l-1 1H5l-1-1V4zm9 3l-3-3H5v10h8V7z"
        />
        <path fillRule="evenodd" clipRule="evenodd" d="M3 1L2 2v10l1 1V2h6.414l-1-1H3z" />
    </svg>
)

export const InsertCodeBlockIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg role="img" height="16" width="16" viewBox="0 0 16 16" fill="currentColor">
        <path
            fillRule="evenodd"
            clipRule="evenodd"
            d="M14 1L15 2V6L14 7L6 7L5 6L5 2L6 1L14 1ZM14 2L6 2L6 6L14 6L14 2Z"
        />
        <path
            fillRule="evenodd"
            clipRule="evenodd"
            d="M14 9L15 10V14L14 15L6 15L5 14L5 10L6 9L14 9ZM14 10L6 10L6 14L14 14L14 10Z"
        />
        <path d="M1 6.39268L2.61414 8.00682L1 9.62096L1.69352 10.3141L4 8.00682L1.69352 5.69995L1 6.39268Z" />
    </svg>
)

export const CheckCodeBlockIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg role="img" height="16" width="16" viewBox="0 0 16 16" fill="currentColor">
        <path d="M3,1L2,2v10l1,1V2h6.4l-1-1H3z" />
        <path d="M7.8,14.7c-0.2-0.2-0.3-0.5-0.4-0.7H5V4h5l3,3v0.1c0.3,0.1,0.7,0.2,1,0.3V6.6L10.4,3H5L4,4v10l1,1h3C8,14.9,7.9,14.8,7.8,14.7z" />
        <path
            fillRule="evenodd"
            clipRule="evenodd"
            d="M9.8,8.7c1.8-1.2,4.3-0.8,5.6,1.1s0.8,4.3-1.1,5.6c0,0,0,0,0,0c-1.8,1.2-4.3,0.7-5.5-1.1C7.5,12.4,8,9.9,9.8,8.7z M11.9,13.7l2.4-3.2l-0.8-0.6l-2.1,2.8l-1.3-1l-0.6,0.8l1.7,1.4L11.9,13.7L11.9,13.7z"
        />
    </svg>
)

// TODO: Delete this if Guardrails does not need it any more.
export const ShieldIcon =
    '<svg role="img" height=16 width=16 viewBox="0 0 16 16" fill="currentColor"><path fillRule="evenodd" clipRule="evenodd" d="M8.24599 14.713C7.73426 14.4115 7.23234 14.0937 6.74099 13.76C6.23999 13.42 5.75799 13.053 5.29699 12.66C4.83899 12.265 4.40899 11.84 4.00899 11.386C3.60899 10.931 3.25599 10.436 2.95899 9.90801C2.66018 9.37408 2.42523 8.80684 2.25899 8.21801C2.08478 7.59364 1.99762 6.94821 1.99999 6.30001V3.10001L2.49999 2.60001C2.83299 2.60001 3.15599 2.58901 3.46999 2.56401C3.76599 2.54101 4.06099 2.49801 4.35199 2.43601C4.63599 2.37401 4.91399 2.28801 5.18399 2.18001C5.46799 2.06201 5.74099 1.91901 5.99999 1.75301C6.36712 1.5117 6.76546 1.32161 7.18399 1.18801C7.83322 1.00041 8.51476 0.95202 9.18399 1.04601C9.61431 1.10595 10.0321 1.2353 10.421 1.42901C10.62 1.52601 10.813 1.63301 11.001 1.75101C11.261 1.91801 11.536 2.06101 11.822 2.17901C12.092 2.28801 12.369 2.37301 12.653 2.43501C12.944 2.49701 13.24 2.54101 13.537 2.56401C13.848 2.58801 14.171 2.59901 14.504 2.59901L15.004 3.09901V6.29901C15.0074 6.94741 14.9212 7.59317 14.748 8.21801C14.5817 8.80683 14.3468 9.37406 14.048 9.90801C13.7501 10.4357 13.3982 10.931 12.998 11.386C12.598 11.838 12.169 12.263 11.712 12.656C11.2506 13.0499 10.7672 13.4172 10.264 13.756C9.7707 14.0903 9.26712 14.4091 8.75399 14.712H8.24599V14.713ZM2.99999 3.59001V6.30001C2.99599 6.85501 3.06999 7.41001 3.21999 7.94501C3.36397 8.45853 3.56875 8.95303 3.82999 9.41801C4.09299 9.88501 4.40499 10.323 4.75999 10.726C5.12999 11.143 5.52599 11.536 5.94799 11.9C6.37999 12.268 6.83099 12.612 7.29999 12.93C7.69999 13.197 8.09999 13.453 8.49999 13.699C8.89999 13.457 9.29999 13.201 9.69999 12.931C10.17 12.612 10.623 12.268 11.055 11.9C11.476 11.536 11.872 11.144 12.241 10.728C12.5951 10.3251 12.9068 9.88682 13.171 9.42001C13.432 8.95501 13.637 8.46001 13.781 7.94701C13.931 7.41001 14.004 6.85701 14.001 6.30001V3.59001C13.842 3.59001 13.688 3.57801 13.536 3.56701L13.457 3.56101C13.1148 3.53403 12.7748 3.48493 12.439 3.41401C11.7376 3.26082 11.0687 2.98528 10.463 2.60001C10.3073 2.50147 10.1464 2.41134 9.98099 2.33001C9.684 2.18399 9.3657 2.0861 9.03799 2.04001C8.51704 1.96366 7.98579 1.99981 7.47999 2.14601C7.14799 2.25401 6.83099 2.40601 6.53999 2.59801C6.22799 2.79801 5.89999 2.97001 5.55699 3.11101C5.23259 3.24045 4.89814 3.34313 4.55699 3.41801C4.22199 3.48801 3.88199 3.53801 3.53999 3.56401C3.36599 3.57401 3.18499 3.58401 2.99999 3.59001Z"/><path d="M7.89199 5.702L6.07499 7.53L7.89099 9.35L7.18399 10.057L5.01299 7.883V7.176L7.18299 4.997L7.89199 5.702Z"/><path d="M9.81 4.972L9.11 5.681L10.94 7.5L9.11 9.32L9.81 10.029L12 7.856V7.147L9.81 4.972Z"/></svg>'

export const SparkleIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg
        role="img"
        width="16"
        height="16"
        viewBox="0 0 16 16"
        xmlns="http://www.w3.org/2000/svg"
        fill="currentColor"
    >
        <path d="M5.39804 10.8069C5.57428 10.9312 5.78476 10.9977 6.00043 10.9973C6.21633 10.9975 6.42686 10.93 6.60243 10.8043C6.77993 10.6739 6.91464 10.4936 6.98943 10.2863L7.43643 8.91335C7.55086 8.56906 7.74391 8.25615 8.00028 7.99943C8.25665 7.74272 8.56929 7.54924 8.91343 7.43435L10.3044 6.98335C10.4564 6.92899 10.5936 6.84019 10.7055 6.7239C10.8174 6.60762 10.9008 6.467 10.9492 6.31308C10.9977 6.15916 11.0098 5.99611 10.9847 5.83672C10.9596 5.67732 10.8979 5.52591 10.8044 5.39435C10.6703 5.20842 10.4794 5.07118 10.2604 5.00335L8.88543 4.55635C8.54091 4.44212 8.22777 4.24915 7.97087 3.99277C7.71396 3.73638 7.52035 3.42363 7.40543 3.07935L6.95343 1.69135C6.88113 1.48904 6.74761 1.31428 6.57143 1.19135C6.43877 1.09762 6.28607 1.03614 6.12548 1.01179C5.96489 0.987448 5.80083 1.00091 5.64636 1.05111C5.49188 1.1013 5.35125 1.18685 5.23564 1.30095C5.12004 1.41505 5.03265 1.55454 4.98043 1.70835L4.52343 3.10835C4.40884 3.44317 4.21967 3.74758 3.97022 3.9986C3.72076 4.24962 3.41753 4.44067 3.08343 4.55735L1.69243 5.00535C1.54065 5.05974 1.40352 5.14852 1.29177 5.26474C1.18001 5.38095 1.09666 5.52145 1.04824 5.67523C0.999819 5.82902 0.987639 5.99192 1.01265 6.1512C1.03767 6.31048 1.0992 6.46181 1.19243 6.59335C1.32027 6.7728 1.50105 6.90777 1.70943 6.97935L3.08343 7.42435C3.52354 7.57083 3.90999 7.84518 4.19343 8.21235C4.35585 8.42298 4.4813 8.65968 4.56443 8.91235L5.01643 10.3033C5.08846 10.5066 5.22179 10.6826 5.39804 10.8069ZM5.48343 3.39235L6.01043 2.01535L6.44943 3.39235C6.61312 3.8855 6.88991 4.33351 7.25767 4.70058C7.62544 5.06765 8.07397 5.34359 8.56743 5.50635L9.97343 6.03535L8.59143 6.48335C8.09866 6.64764 7.65095 6.92451 7.28382 7.29198C6.9167 7.65945 6.64026 8.10742 6.47643 8.60035L5.95343 9.97835L5.50443 8.59935C5.34335 8.10608 5.06943 7.65718 4.70443 7.28835C4.3356 6.92031 3.88653 6.64272 3.39243 6.47735L2.01443 5.95535L3.40043 5.50535C3.88672 5.33672 4.32775 5.05855 4.68943 4.69235C5.04901 4.32464 5.32049 3.88016 5.48343 3.39235ZM11.5353 14.8494C11.6713 14.9456 11.8337 14.9973 12.0003 14.9974C12.1654 14.9974 12.3264 14.9464 12.4613 14.8514C12.6008 14.7529 12.7058 14.6129 12.7613 14.4514L13.0093 13.6894C13.0625 13.5309 13.1515 13.3869 13.2693 13.2684C13.3867 13.1498 13.5307 13.0611 13.6893 13.0094L14.4613 12.7574C14.619 12.7029 14.7557 12.6004 14.8523 12.4644C14.9257 12.3614 14.9736 12.2424 14.9921 12.1173C15.0106 11.9922 14.9992 11.8645 14.9588 11.7447C14.9184 11.6249 14.8501 11.5163 14.7597 11.428C14.6692 11.3396 14.5591 11.2739 14.4383 11.2364L13.6743 10.9874C13.5162 10.9348 13.3724 10.8462 13.2544 10.7285C13.1364 10.6109 13.0473 10.4674 12.9943 10.3094L12.7423 9.53638C12.6886 9.37853 12.586 9.24191 12.4493 9.14638C12.3473 9.07343 12.2295 9.02549 12.1056 9.00642C11.9816 8.98736 11.8549 8.99772 11.7357 9.03665C11.6164 9.07558 11.508 9.142 11.4192 9.23054C11.3304 9.31909 11.2636 9.42727 11.2243 9.54638L10.9773 10.3084C10.925 10.466 10.8375 10.6097 10.7213 10.7284C10.6066 10.8449 10.4667 10.9335 10.3123 10.9874L9.53931 11.2394C9.38025 11.2933 9.2422 11.3959 9.1447 11.5326C9.04721 11.6694 8.99522 11.8333 8.99611 12.0013C8.99699 12.1692 9.0507 12.3326 9.14963 12.4683C9.24856 12.604 9.38769 12.7051 9.54731 12.7574L10.3103 13.0044C10.4692 13.0578 10.6136 13.1471 10.7323 13.2654C10.8505 13.3836 10.939 13.5283 10.9903 13.6874L11.2433 14.4614C11.2981 14.6178 11.4001 14.7534 11.5353 14.8494ZM10.6223 12.0564L10.4433 11.9974L10.6273 11.9334C10.9291 11.8284 11.2027 11.6556 11.4273 11.4284C11.6537 11.1994 11.8248 10.9216 11.9273 10.6164L11.9853 10.4384L12.0443 10.6194C12.1463 10.9261 12.3185 11.2047 12.5471 11.4332C12.7757 11.6617 13.0545 11.8336 13.3613 11.9354L13.5563 11.9984L13.3763 12.0574C13.0689 12.1596 12.7898 12.3322 12.5611 12.5616C12.3324 12.791 12.1606 13.0707 12.0593 13.3784L12.0003 13.5594L11.9423 13.3784C11.8409 13.0702 11.6687 12.7901 11.4394 12.5605C11.2102 12.3309 10.9303 12.1583 10.6223 12.0564Z" />
    </svg>
)

export const EllipsisIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg
        role="img"
        width="16"
        height="16"
        viewBox="0 0 16 16"
        xmlns="http://www.w3.org/2000/svg"
        fill="currentColor"
    >
        <path d="M4 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm5 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z" />
    </svg>
)

export const SyncSpinIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg
        className={styles.spin}
        role="img"
        width="16"
        height="16"
        viewBox="0 0 16 16"
        xmlns="http://www.w3.org/2000/svg"
        fill="currentColor"
    >
        <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M2.006 8.267L.78 9.5 0 8.73l2.09-2.07.76.01 2.09 2.12-.76.76-1.167-1.18a5 5 0 0 0 9.4 1.983l.813.597a6 6 0 0 1-11.22-2.683zm10.99-.466L11.76 6.55l-.76.76 2.09 2.11.76.01 2.09-2.07-.75-.76-1.194 1.18a6 6 0 0 0-11.11-2.92l.81.594a5 5 0 0 1 9.3 2.346z"
        />
    </svg>
)

export const TickIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg
        role="img"
        width="16"
        height="16"
        viewBox="0 0 16 16"
        xmlns="http://www.w3.org/2000/svg"
        fill="currentColor"
    >
        <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"
        />
    </svg>
)

export const CloseIcon = (
    // biome-ignore lint/a11y/noSvgWithoutTitle: These are titled by the button that contains the icon.
    <svg
        role="img"
        width="16"
        height="16"
        viewBox="0 0 16 16"
        xmlns="http://www.w3.org/2000/svg"
        fill="currentColor"
    >
        <path
            fill-rule="evenodd"
            clip-rule="evenodd"
            d="M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"
        />
    </svg>
)

export const RefreshIcon = <i className="codicon codicon-refresh tw-align-middle" />
